package top.rainf.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.rainf.domain.dto.AreaWithBlocks;
import top.rainf.domain.vo.Area;
import top.rainf.mapper.AreaMapper;
import top.rainf.service.IAreaService;

import java.util.List;

/**
 * @author 星环
 * @date 2023/5/10 11:36:45
 * @description
 */
@Service
public class AreaService implements IAreaService {

    @Autowired
    AreaMapper areaMapper;

    @Override
    public List<Area> getAreaList() {
        return areaMapper.selectAllArea();
    }


    @Override
    public List<Area> getFullAreaList(int nowPage,int numPerPage) {
        return areaMapper.getFullListPaged((nowPage-1) * numPerPage,numPerPage);
    }

    @Override
    public List<AreaWithBlocks> getAreaListWithBlocks() {
        return areaMapper.selectAreaWithBlocks();
    }

    @Override
    public Area getOneById(int id) {
        //return areaMapper.selectById(id);
        return null;
    }

    @Override
    public boolean deleteOneById(int id) {
        //return areaMapper.deleteById() == 1;
        return false;
    }

    @Override
    public boolean deleteAll(List<Integer> idList) {
        //return areaMapper.deleteByIdList(idList) == idList.size();
        return false;
    }

    @Override
    public boolean updateById(Area area) {
        //return areaMapper.updateById(area) == 1;
        return false;
    }
}
